// 定义申请状态
export type ApplicationStatus =
  | 'DRAFT'
  | 'PENDING_HEAD_REVIEW'
  | 'PENDING_FINANCE_REVIEW'
  | 'PENDING_GM_REVIEW'
  | 'COMPLETED'
  | 'REJECTED'
  | 'CANCELLED' // 已撤销状态

// 定义用户角色
export type UserRole = 'employee' | 'head' | 'finance' | 'gm'

// 定义费用类型
export type ExpenseType = 'office' | 'travel' | 'entertainment' | 'equipment' | 'training' | 'other'

// 定义审批记录
export interface ApprovalRecord {
  id: string
  approverId: string
  approverName: string
  action: 'approve' | 'reject' | 'submit' | 'cancel' // 添加撤销操作
  comment: string
  timestamp: string
}

// 定义报销申请
export interface ReimbursementApplication {
  id: string
  applicantId: string
  applicantName: string
  amount: number
  description: string
  expenseType: ExpenseType // 费用类型
  invoiceInfo?: string // 发票信息（可选）
  status: ApplicationStatus
  history: ApprovalRecord[]
  createdAt: string // 创建时间
  updatedAt: string // 更新时间
}

// 定义用户
export interface User {
  id: string
  name: string
  role: UserRole
  department?: string // 部门信息
}

// 定义费用类型映射
export const EXPENSE_TYPE_LABELS: Record<ExpenseType, string> = {
  office: '办公用品',
  travel: '差旅费用',
  entertainment: '招待费用',
  equipment: '设备采购',
  training: '培训费用',
  other: '其他费用',
}

// 定义状态映射
export const STATUS_LABELS: Record<ApplicationStatus, string> = {
  DRAFT: '草稿',
  PENDING_HEAD_REVIEW: '待部门主管审批',
  PENDING_FINANCE_REVIEW: '待财务审核',
  PENDING_GM_REVIEW: '待总经理终审',
  COMPLETED: '已完成',
  REJECTED: '已驳回',
  CANCELLED: '已撤销',
}
